import java.util.Scanner;

public class demo01 {
    public static String s="A   3  HIL JM O   2TUVWXY51SE Z  8 ";
    public static char func(char ch){
        if(Character.isDigit(ch)){
            return s.charAt(ch-'0'+25);
        }
        return s.charAt(ch-'A');
    }
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        String str=sc.nextLine();
        char[] arr=str.toCharArray();
        int flag1=1;
        int flag2=2;
        for (int i = 0; i < (arr.length+1)/2; i++) {
            if(arr[i]!=arr[str.length()-1-i]){
                flag1=-1;
            }
            char ch=func(arr[i]);
            if(ch!=arr[str.length()-1-i]){
                flag2=-2;
            }
        }
        if(flag1==1){
            System.out.println("回文词！");
        }else if (flag1==-1){
            System.out.println("不是回文词！");
        }
        if(flag2==2){
            System.out.println("镜像词！");
        }else if (flag2==-2){
            System.out.println("不是镜像词！");
        }
    }
}
